/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package renderers;

import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import model.UserRole;



/**
 *
 * @author admin
 */
public class TableCellUserRolesRenderer extends DefaultTableCellRenderer
{
    private static final long serialVersionUID = 1L;
    
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,int row,int col)
    {

        Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);

        UserRole ur = (UserRole) table.getModel().getValueAt(row, col);
        if(ur!=null)
          {
             setText(ur.getRoleName());
          }
        return this;
    }  
    
}
